/***************************************************************************
 创建者: 华磊
 开始时间: 2020.8.14
 copyright: (C) 深圳市华友高科有限公司
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2020.5.8 类的具体实现代码编写

 ***************************************************************************/
#include "basemapimage.h"

BaseMapImage::BaseMapImage(QObject *parent) :
    QObject(parent)
{
//    setFlag(QGraphicsItem::ItemIsMovable);
//    baseMapPicture.load("/agvwork/AgvHmi/baseBag/hmiProject/resources/mapView/maps/chejian01.pgm");
}

int BaseMapImage::reloadMap(QString mapPgm)
{
    return baseMapPicture.load(mapPgm);
}

QRectF BaseMapImage::boundingRect() const
{

//    return QRectF(-baseMapPicture.width()/2,-baseMapPicture.height()/2,
//                baseMapPicture.width(),baseMapPicture.height());
    return QRectF(0,0,
               baseMapPicture.width(),baseMapPicture.height());
}

void BaseMapImage::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{

//     painter->drawPixmap(boundingRect().center(),baseMapPicture);
    painter->drawPixmap(0,0,baseMapPicture);


}
